package com.systop.payment.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.systop.common.validator.group.AddGroup;
import com.systop.common.validator.group.UpdateGroup;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 
 * 
 * @author jsj
 * @email jsj@gmail.com
 * @date 2022-05-05 11:46:06
 */
@Data
@TableName("payment_order")
public class OrderEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 出货id
	 */
	@TableId
	@Null(groups = {AddGroup.class},message = "添加时不允许携带商品id")
	@NotNull(groups = {UpdateGroup.class},message = "修改时必须携带商品id")
	private Integer id;
	/**
	 * 客户
	 */
	@NotBlank(groups = {AddGroup.class},message = "添加时必须填写客户")
	private String customer;
	/**
	 * 出货时间
	 */
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	@Null(groups = {AddGroup.class,UpdateGroup.class},message = "时间不能手动填写")
	private Date createtime;
	/**
	 * 支付方式
	 */
	@NotNull(groups = {AddGroup.class},message = "添加时必须填写支付方式")
	private String paytype;
	/**
	 * 备注
	 */
	private String remarks;
	/**
	 * 发货人
	 */
	@NotNull(groups = {AddGroup.class},message = "添加时必须填写发货人")
	private String business;

	@TableField(exist = false)
	@NotNull(groups = {AddGroup.class},message = "添加时必须填写商品细节信息")
	private List<OrderSubjoinEntity> subjoinList;
}
